﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using Passwords.Models;
using System.Windows;

namespace Passwords.Utils
{
    class DisplayModeToVisibilityConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (!(value is DisplayMode)) return value;
            DisplayMode target = parameter is DisplayMode ? (DisplayMode)parameter : DisplayMode.Passwords;

            DisplayMode mode = (DisplayMode)value;
            return mode == target ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
